package com.cet.lxf.annotation.test01;

/**
 * @program: algorithm
 * @description:
 * @author: 陈恩涛
 * @create: 2021-07-29 16:44
 **/
public class Main01 {
    public static void main(String[] args) throws NoSuchFieldException, NoSuchMethodException {
        // 判断@Report是否存在于Person类上
        System.out.println(Person.class.isAnnotationPresent(Report.class));
        // 判断@Report是否存在于字段age上
        System.out.println(Person.class.getDeclaredField("age").isAnnotationPresent(Report.class));
        // 判断@Report是否存在于方法getName()上
        System.out.println(Person.class.getMethod("getName").isAnnotationPresent(Report.class));
    }
}
